<style>
#addAndEditModal .modal-body{
    align-items: center;
}

#addAndEditModal .modal-body p{
	margin: 0;
	margin-right: 16px;
}
</style>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- 交易记录页面 -->
<section class="main-content transactionRecord view">
	<div class="ivu-tabs">
		<div class="ivu-tabs-bar">
			<div class="ivu-tabs-nav-container">
				<div class="ivu-tabs-nav-wrap" style="position: relative;"><span class="ivu-tabs-nav-prev ivu-tabs-nav-scroll-disabled"><i class="ivu-icon ivu-icon-chevron-left"></i></span> <span class="ivu-tabs-nav-next ivu-tabs-nav-scroll-disabled"><i class="ivu-icon ivu-icon-chevron-right"></i></span>
					<div class="ivu-tabs-nav-scroll">
						<div class="nav-text ivu-tabs-nav">
							<div class="ivu-tabs-ink-bar ivu-tabs-ink-bar-animated" style="display: block; width: 100px; transform: translate3d(0px, 0px, 0px);"></div>
							<div class="ivu-tabs-tab ivu-tabs-tab-active">
								彩票投注记录
							</div>
							<div class="ivu-tabs-tab">
								棋牌投注记录
							</div>
							<div class="ivu-tabs-tab">
								流水记录
							</div>
						</div>
					</div><object tabindex="-1" type="text/html" data="about:blank" style="display: block; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; border: none; padding: 0px; margin: 0px; opacity: 0; z-index: -1000; pointer-events: none;"></object></div>
			</div>
		</div> 
		<div class="ivu-tabs-content ivu-tabs-content-animated" style="transform: translateX(0%) translateZ(0px);">
			<div class="ivu-tabs-tabpane">
				<section data-v-2e4b69b1="" class="digital-betting-record">
					<div data-v-2e4b69b1="" class="search"><span data-v-2e4b69b1="">状态：</span>
						<select data-v-2e4b69b1="" class="select TZstate">
							<!-- <option data-v-2e4b69b1="" value="all">
								全部
							</option> -->
							<option value="10">开奖状态</option>
							<option value="1">&nbsp;&nbsp;待开奖</option>
							<option value="3">&nbsp;&nbsp;已中奖</option>
							<option value="2">&nbsp;&nbsp;未中奖</option>
							<option value="7">&nbsp;&nbsp;已撤单</option>
							<option value="6">&nbsp;&nbsp;和局中奖</option>
						</select><span data-v-2e4b69b1="">彩种：</span>
							
						<select data-v-2e4b69b1="" class="select select-width"></select> 
						<button data-v-2e4b69b1="" class="button" id="lot-btn">查询</button></div>
					<table data-v-2e4b69b1="" id="table_touzhu" class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover">  <!--TODO  -->
						<thead data-v-2e4b69b1="">
							<tr data-v-2e4b69b1="">
								<th style='hidden-c'></th>
								<th data-v-2e4b69b1="">彩种名称</th>
								<th data-v-2e4b69b1="">期号</th>
								<th data-v-2e4b69b1="">投注时间</th>
								<th data-v-2e4b69b1="">注数</th>
								<th data-v-2e4b69b1="">投注金额</th>
								<th data-v-2e4b69b1="">中奖金额</th> 
								<th data-v-2e4b69b1="">状态</th> 
								<th data-v-2e4b69b1="">投注详情</th> 
							</tr>
						</thead>
						<tbody data-v-2e4b69b1="">
						</tbody>
					</table>
				</section>
			</div>
			
			<div class="ivu-tabs-tabpane">
				<section data-v-2e4b69b1="" class="digital-betting-record">
					<div data-v-2e4b69b1="" class="search"><span data-v-2e4b69b1="">状态：</span>
						<select data-v-2e4b69b1="" class="select ChessState">
							<!-- <option data-v-2e4b69b1="" value="all">
								全部
							</option> -->
							<option value="">开奖状态</option>
							<option value="2">&nbsp;&nbsp;待开奖</option>
							<option value="1">&nbsp;&nbsp;已中奖</option>
							<option value="0">&nbsp;&nbsp;未中奖</option>
						<select data-v-2e4b69b1="" class="select select-width"></select> 
						<button data-v-2e4b69b1="" class="button" id="chess-btn">查询</button></div>
					<table data-v-2e4b69b1="" id="chess_touzhu" class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover">  <!--TODO  -->
						<thead data-v-2e4b69b1="">
							<tr data-v-2e4b69b1="">
								<th data-v-2e4b69b1="" style='hidden-c' ></th>
								<th data-v-2e4b69b1="">彩种名称</th>
								<th data-v-2e4b69b1="">期号</th>
								<th data-v-2e4b69b1="">投注时间</th>
								<th data-v-2e4b69b1="">下注金额</th>
								<th data-v-2e4b69b1="">中奖金额</th>
								<th data-v-2e4b69b1="">桌号</th> 
								<th data-v-2e4b69b1="">开奖状态</th> 
								<th data-v-2e4b69b1="">投注详情</th> 
							</tr>
						</thead>
						<tbody data-v-2e4b69b1="">
						</tbody>
					</table>
				</section>
			</div>
			<div class="ivu-tabs-tabpane">
				<section data-v-30e14d66="" class="transaction-record">
					<div data-v-30e14d66="" class="search BiandType"><span data-v-30e14d66="">变动类型：</span>
						<select data-v-30e14d66="" class="select">
							<option data-v-30e14d66="" value="">全部</option>
							<option>快速充值</option>
							<option>快速提款</option>
							<option>人工扣款</option>
							<option>人工加款</option>
							<option>每日返水</option>
							<option>每月返水</option>
							<option>代理返点</option>
							<option>红包抽中</option>
							<option>红包扣除</option>
							<option>活动赠送</option>
						</select> <span data-v-30e14d66="">时间：</span>
						<div data-v-30e14d66="" class="ivu-date-picker" style="width: 500px;">
							<div class="ivu-date-picker-rel">
								<input type="text" id="date1" placeholder="开始时间" value="" lay-key="" class="ivu-input layer-date" readonly="readonly">
								<span style="margin: 0 10px;">至</span>
								<input type="text" id="date2" placeholder="结束时间" value="" lay-key="" class="ivu-input layer-date" readonly="readonly">
							</div>
							<div class="ivu-select-dropdown" style="display: none;">
								<div></div>
							</div>
						</div> <button data-v-30e14d66="" class="button LiuShuijl">查询</button></div>
					<table data-v-30e14d66="" id="table_liushui" class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover">
						<thead data-v-30e14d66="">
							<tr data-v-30e14d66="">
								<th data-v-30e14d66="">变动类型</th>
								<th data-v-30e14d66="">变动前金额</th>
								<th data-v-30e14d66="">变动金额</th>
								<th data-v-30e14d66="">变动后金额</th>
								<th data-v-30e14d66="">操作时间</th>
							</tr>
						</thead>
						<tbody data-v-30e14d66="">
							<tr data-v-30e14d66="">
								<td colspan="20" style="text-align: center; padding: 20px 0px;">没有更多的数据了</td>
								</tr>
							</tbody>
						</table>
					</section>
				</div>
			</div>
		</div>
</section>
<script type="text/javascript">
layui.use('laydate', function() { //layui时间插件
	 laydate= layui.laydate;
	laydate.render({
		elem: '#date1'
	});
	laydate.render({
		elem: '#date2'
	});
});
$(".digital-betting-record").show()
$(".transaction-record").show()
var StartDate2 //充值记录的开始时间
var EndDate2
var status = "";
var state = 10;
var bdtype = ""
var cname = ""
var s1 = GetDateStr(0);
$("#date1").val(s1);
$("#date2").val(s1);
StartDate2 = $("#date1").val();
EndDate2 = $("#date2").val();
$(".ivu-tabs-nav .ivu-tabs-tab").on("click", function() {
	var index = $(this).index() - 1;
	var sub = -index;
	sub = sub * 100 + "%";
	var distance = index * 116
	$(this).addClass("ivu-tabs-tab-active").siblings().removeClass("ivu-tabs-tab-active")
	$(".ivu-tabs-ink-bar-animated").css("transform", "translate3d(" + distance + "px, 0px, 0px)")
	$(".ivu-tabs-content-animated").css("transform", "translateX(" + sub + ") translateZ(0px)")
})
dataTable_myOrders();
dataTable_chessTouzhu();
findXiangqing()
SYlotter()
dataTable_myLiushui()
$("#lot-btn").on("click", function() {
	state = $(".TZstate").val()
	cname = $(".select-width").val()
	console.log(state)
	console.log(cname)
	dataTable_myOrders();
})

/* 根据开奖状态查询棋牌下注记录 */
$("#chess-btn").on("click", function() {
	status = $(".ChessState").val();
	dataTable_chessTouzhu();
})

/* 查看棋牌投注详情  */
$("#chess_touzhu").on("click", ".butt-xiangqing", function() {
	$("#addAndEditModal").modal("show")
	var id = $(this).parent().parent().find(".id-td").text()
	$.ajax({
		type: "post",
		url: "/b/bettingRecord.do",
		"data": {
			'id': id
		},
		success: function(data) {
			var newData = data.data
			var body = $("#addAndEditModal .modal-body")
			body.empty();
			var html = ""
			$("#addAndEditModal .modal-header").show();
			$(".chess-header").show();
			$(".chess-header").text("第" + newData.tableNumber + "桌")
			html += "<p><span class='backbet'>期号：</span><input value='" + newData.issueNumber + "' class='form-control backCor issueNumber' id='input-i-qihao1' readonly /><p><span class='backbet'>开奖结果：</span>";
			if(newData.state != 1) {

				if(newData.state == 0) {
					newData.state = "待开奖";
				}
				if(newData.state == 2) {
					newData.state = "开奖异常,已退款";
				}
				html += "<input value='" + newData.state + "'class='form-control backCor' id='input-i-name1' readonly /></p>";
			} else if(newData.state == 1) {
				html += "<div class='puke'><div class='zhuangCard'><span>庄牌：</span><img class='pukeCard' src='/img/caizhong/bjl/" + newData.zhuang1 + ".png' /><img class='pukeCard' src='/img/caizhong/bjl/" + newData.zhuang2 + ".png' />";
				if(newData.dealerCard != null) {
					html += "<img class='pukeCard' src='/img/caizhong/bjl/" + newData.dealerCard + ".png' />";
				}
				html += "</div><div class='xianCard'><span>闲牌：</span><img class='pukeCard' src='/img/caizhong/bjl/" + newData.leisure1 + ".png' /><img class='pukeCard' src='/img/caizhong/bjl/" + newData.leisure2 + ".png' />";
				if(newData.dealerCard != null) {
					html += "<img class='pukeCard' src='/img/caizhong/bjl/" + newData.dealerCard + ".png' />";
				}
				html += "</div></div></p>"
			}
			body.append(html)
			if(newData.state != 1) {
				$(".issueNumber").css("width", "250px");
			} else if(newData.state != 0) {
				$(".issueNumber").css("width", "130px");
			}
			if(newData.zhuang == "庄") {
				body.append("<p><span>下注玩法：</span><input value='庄' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.amountOfMoney + "元' class='form-control' readonly /></p>")
			}
			if(newData.xian == "闲") {
				body.append("<p><span>下注玩法：</span><input value='闲' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.cashDownAmount + "元' class='form-control' readonly /></p>")
			}
			if(newData.zhuangdui == "庄对") {
				body.append("<p><span>下注玩法：</span><input value='庄对' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.zhuangdusBetOnTheAmount + "元' class='form-control' readonly /></p>")
			}
			if(newData.xiandui == "闲对") {
				body.append("<p><span>下注玩法：</span><input value='闲对' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.cashPairDownAmount + "元' class='form-control' readonly /></p>")
			}
			if(newData.he == "和") {
				body.append("<p><span>下注玩法：</span><input value='和' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.andTheAmountOfTheBet + "元' class='form-control' readonly /></p>")
			}
			if(newData.large == "大") {
				body.append("<p><span>下注玩法：</span><input value='大' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.largeBetAmount + "元' class='form-control' readonly /></p>")
			}
			if(newData.small == "小") {
				body.append("<p><span>下注玩法：</span><input value='小' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.smallBetAmount + "元' class='form-control' readonly /></p>")
			}
			if(newData.arbitraryPairsx == "任意对子") {
				body.append("<p><span>下注玩法：</span><input value='任意对子' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.arbitraryPairAmount + "元' class='form-control' readonly /></p>")
			}
			if(newData.perfectPairx == "完美对子") {
				body.append("<p><span>下注玩法：</span><input value='完美对子' class='form-control' readonly /></p><p><span>下注金额：</span><input value='" + newData.perfectPairAmount + "元' class='form-control' readonly /></p>")
			}
		}
	});
})

$(".search .LiuShuijl").on("click", function() {
	bdtype = $(".BiandType").find("option:selected").text()
	if(bdtype == "全部") {
		bdtype = ""
	}
	StartDate2 = $("#date1").val();
	EndDate2 = $("#date2").val();
	console.log(StartDate2)
	dataTable_myLiushui();
})	
</script>
